<?php
import("com.yado.SQLException");
import("com.mysql.yado.ResultSet");
class PrepearedStatement {
	private $_connection;
	private $_sql;
	private $_result;
	public function __construct($connection,$sql){
		$this->_connection = $connection;
		$this->_sql = $sql;
	}
	public function execute(){
		$this->_result=mysql_query($this->_sql,$this->_connection);
		if (mysql_errno($this->_connection)){
			throw new SQLException(mysql_error($this->_connection),$this->_sql);
		}
	}
	
	/**
	 * Enter description here...
	 *
	 * @return ResultSet
	 */
	public function getResultSet(){
		$rows = array();
		while ($row = mysql_fetch_array($this->_result)){
			array_push($rows,$row);
		}
		mysql_free_result($this->_result);
		return new ResultSet($rows);
	}
}

?>